<?php

namespace App\Http\Controllers;

use App\Interfaces\BillerInterface;
use App\Logic\DbUserRepository;
use App\User;
use Illuminate\Http\Request;
use Illuminate\View\View;

class UserController extends Controller
{

    public $users;
    public $biller;
    /**
     * UserController constructor.
     */
    public function __construct(DbUserRepository $users,BillerInterface $biller)
    {
        $this->users = $users;
        $this->biller = $biller;


    }
    /**
     *  控制器知道太多了，其实控制器不需要知道数据是来做那里的
     *  控制器没有和数据层解耦
     *  每一个类都是单一职责
     * @return mixed
     */
    public function getIndex(){
        $users= $this->users->all();
        return View::make('user.index',compact('users'));
    }

    public function index(){
        $fooService1 = app()->make('App\Contracts\SktContract');
        $fooService2= app()->make('App\Contracts\SktContract');

        $fooService3 = app()->make('skt');
        $fooService4 =app()->make('skt');

        $fooService1->name = '111';
        $fooService2->name = '222';
        $fooService3->name = '333';
        $fooService4->name = '444';

        $fooService1->list_team('LOL-ssb');
    }
}
